package com.cskaoyan.javase.oop3._1interface._6extend;

/**
 * 操作方法调用就是操作方法的返回值
 * 而能够进行链式调用的前提是返回值是一个对象
 *
 * @since 09:38
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo2 {
    public static void main(String[] args) {
        System.out.println("hello world!");
        new Student().getStudent().getTeacher().show();
    }
}

class Student {

    public Student getStudent() {
        return new Student();
    }

    public Teacher getTeacher() {
        return new Teacher();
    }
}

class Teacher {
    public void show() {
        System.out.println("秀一波~~~");
    }
}